package com.bzkj.web.controller.ncc;

import com.bzkj.basicinfo.service.ncc.NccBasicBillsTypeService;
import com.bzkj.common.core.controller.BaseController;
import com.bzkj.common.core.domain.R;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/ncc/basic/billsType")
public class NccBasicBillsTypeController extends BaseController
{

    @Autowired
    private NccBasicBillsTypeService basicBillsTypeService;

    /**
     * NCC单据分类
     */
    @GetMapping({"/nccBasicBillsTypeJob", "/nccBasicBillsTypeJob/{all}"})
    @PreAuthorize("@ss.hasPermi('ncc:BillsType:Job')")
    public void nccBasicBillsTypeJob(@PathVariable(required = false) String all)
    {
        basicBillsTypeService.updateNccBasicBillsTypeJob(all);
    }

    /**
     * 定时同步当前单据类型信息
     *
     * @return
     */
    @GetMapping("jobMethod")
    public R jobMethod()
    {
        return basicBillsTypeService.jobMethod(false);
    }


    /**
     * 获取所有wms使用的单据类型
     *
     * @return
     */
    @GetMapping("findWmsUseBillsTypeAll")
    @ApiOperation("查询所有wms使用的单据类型接口")
    public R findWmsUseBillsTypeAll()
    {
        return basicBillsTypeService.findWmsUseBillsTypeAll();
    }


}
